package com.yunhe.policyfulfillment.policyful.repository;

import com.yunhe.policyfulfillment.policyful.domain.AppealSatisfaction;
import com.yunhe.policyfulfillment.policyful.model.DateCondition;
import com.yunhe.policyfulfillment.policyful.model.SatisfactionStatistics;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName: AppealSatisfactionRepository
 * @Description:
 * @author: GongDaCheng
 * @Date: 13:45 2021/10/8
 */
@Repository
public interface AppealSatisfactionRepository {
    
    /**
     * @Description 新增诉求满意度
     * @Param AppealSatisfaction appealSatisfaction
     * @Return int
     * @Date 2021/10/8 13:46
     */
    int createAppealSatisfaction(AppealSatisfaction appealSatisfaction);

    /**
     * @Description 新增诉求满意度
     * @Param AppealSatisfaction appealSatisfaction
     * @Return int
     * @Date 2021/10/8 13:46
     */
    int createAppealSatisfactionSelective(AppealSatisfaction appealSatisfaction);

    /**
     * @Description 删除诉求满意度
     * @Param long id
     * @Return int
     * @Date 2021/10/8 13:46
     */
    int deleteAppealSatisfactionByPrimaryKey(@Param("id") long id);

    /**
     * @Description 更新诉求满意度
     * @Param AppealSatisfaction appealSatisfaction
     * @Return int
     * @Date 2021/10/8 13:46
     */
    int updateAppealSatisfactionByPrimaryKey(AppealSatisfaction appealSatisfaction);

    /**
     * @Description 更新诉求满意度
     * @Param AppealSatisfaction appealSatisfaction
     * @Return int
     * @Date 2021/10/8 13:46
     */
    int updateAppealSatisfactionByPrimaryKeySelective(AppealSatisfaction appealSatisfaction);

    /**
     * @Description 根据诉求满意度id查询诉求满意度
     * @Param long id
     * @Return AppealSatisfaction
     * @Date 2021/10/8 13:49
     */
    AppealSatisfaction searchAppealSatisfactionByPrimaryKey(@Param("id") long id);

    /**
     * @Description 根据诉求id查询诉求满意度
     * @Param long appealId
     * @Return AppealSatisfaction
     * @Date 2021/10/8 13:58
     */
    AppealSatisfaction searchAppealSatisfactionByAppealId(@Param("appealId") long appealId);

    /**
     * @Description 根据满意度统计评价数量
     * @Param String satisfaction
     * @Return int
     * @Date 2021/10/8 14:39
     */
    int getCountBySatisfaction(@Param("satisfaction") String satisfaction, @Param("year") int year);

    /**
     * @Description 根据时间进行满意度统计
     * @Param DateCondition dateCondition
     * @Return List<AppealSatisfaction>
     * @Date 2021/10/9 9:03
     */
    List<SatisfactionStatistics> satisfactionStatistics(DateCondition dateCondition);
}
